#include "stddefs.h"


void Init_ISR_Ext(void)
{
	// External Interrupt(s) initialization
	EIFR = 0x00;
	EICRA = 0x0a;
	EICRB = 0x00;
	EIMSK = 0x03;
}

void Init_ISR_Timer0(void)
{
	ASSR = 0x00;
	// Timer/Counter 1 initialization	// Clock source: System Clock
	// Clock value: 15.625 kHz			// Mode: Normal top=FFh
	// Timer 1 Overflow Interrupt: On
	TCCR0 = 0x07;
	TCNT0 = 0x00;
	
	// Timer(s)/Counter(s) Interrupt(s) initialization
	TIMSK = 0x01;
}


void Init_ISR_Timer3(void)
{
	// Timer/Counter 3 initialization	// Clock source: System Clock
	// Clock value: 15.625 kHz			// Mode: Normal top=FFFFh
	// Timer 3 Overflow Interrupt: On
	TCCR3A = 0x00;
	TCCR3B = 0x05;
	TCNT3 = 65535 - 15625;

	// Timer(s)/Counter(s) Interrupt(s) initialization
	//ETIMSK = 0x04;
}


SIGNAL(SIG_OVERFLOW0)
{


	TCNT0 = 0x00;
}


SIGNAL(SIG_OVERFLOW3)	
{


	TCNT3 = 65535 - 15625;
}


SIGNAL(SIG_INTERRUPT0)
{
//	Usart_Tx(1, '0');

	if( system_mode == 3 )		system_mode = 0;
	else						system_mode++;

}



SIGNAL(SIG_INTERRUPT1)
{
//	Usart_Tx(1, '1');
}



